package com.coldchain.cys.api;

import com.coldchain.authclient.annotation.CheckUserToken;
import com.coldchain.common.msg.BaseResponse;
import com.coldchain.common.msg.ObjectRestResponse;
import com.coldchain.cys.entity.DriverFeedback;
import com.coldchain.cys.mapping.ApiUtils;
import com.coldchain.cys.page.DriverFeedbackQueryVo;
import com.coldchain.cys.service.IDriverFeedbackService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author tianpeng
 * @since 2018-09-20
 */
@RestController
@CheckUserToken
@Api(description="司机意见反馈模块")
public class DriverFeedbackController {

	@Autowired
	private IDriverFeedbackService driverFeedbackService ;
	
	@ApiOperation(value="上传司机意见反馈")
	@ApiImplicitParams(value={
			@ApiImplicitParam(name="content",value="反馈内容",dataType="String",paramType="query"),
	})
	@RequestMapping(value=ApiUtils.DO_ADD_DRIVER_FEEDBACK,method= {RequestMethod.POST})
	public BaseResponse doAddDriverFeedback(@ApiIgnore DriverFeedback driverFeedback) {
		return driverFeedbackService.doAddDriverFeedback(driverFeedback) ;
	}
	
	@ApiOperation(value="司机意见反馈列表")
	@ApiImplicitParams(value={
			@ApiImplicitParam(name="current",value="页码",dataType="Integer",paramType="query"),
			@ApiImplicitParam(name="driverid",value="司机的id",dataType="Long",paramType="query"),
	})
	@RequestMapping(value=ApiUtils.SHOW_DRIVER_FEEDBACK_LIST,method= {RequestMethod.GET})
	public ObjectRestResponse<DriverFeedbackQueryVo> showDriverFeedbackList(DriverFeedbackQueryVo vo){
		driverFeedbackService.getList(vo) ;
		return new ObjectRestResponse<DriverFeedbackQueryVo>(vo) ;
	}
}

